﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Auser.aspx.cs" Inherits="pufflesweb.Auser" %>
<%@ import Namespace="PBLL" %>
<%@ import Namespace="PDAL" %>
<%@ import Namespace="PModel" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>员工管理</title>
    
</head>
<body>
    


    <form id="form1" runat="server" >
        <div >

            <asp:TextBox ID="TextBox1" placeholder="请输入工号" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" Text="搜索" />
            <a href="Aregister.aspx">添加新员工</a>

            <br />
            <br />
            <table  width="800"  border="1">

                <tr><td>工号</td><td>姓名</td><td>密码</td><td>年龄</td><td>职位</td><td>性别</td></tr>

                <%
                    string id = Request.QueryString["AID"];
                    if(id != null)
                    {
                        PBLL.Admin.del(int.Parse(id));
                        PF.JsHelper.AlertAndRedirect("删除成功","Auser.aspx");
                    }

                    List<PModel.Admin> list = PBLL.Admin.list();
                    %>
                <% for (int i = 0; i < list.Count; i++)
                    {
                        string asex = "";
                        if (list[i].Asex == 0)
                        {
                            asex = "男";
                        }
                        else
                        {
                            asex = "女";
                        }

                        %>

                <tr><td><%=list[i].AID%></td><td><% =list[i].Aname%></td><td><%=list[i].Apassword%></td><td><%=list[i].Aage%></td><td><%=list[i].Ajbo%></td><td><%=asex%></td>
                    <td><a href="Auser.aspx?AID=<%=list[i].AID%>">删除</a> | <a href="Auserupdate.aspx?AID=<%=list[i].AID%>">修改</a></td></tr>
                <%} %>
            </table>
        </div>
    </form>
</body>
</html>